package pt.ua.helpdesk.client;

import java.util.ArrayList;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.ServiceDefTarget;

public interface ServiceFaq extends RemoteService {
	
	public Boolean addFaq(Integer idPerson, String question, String answer);
	
	public ArrayList getFaq();
	
	public ArrayList getFaqAll();
	
	public ArrayList viewFaq(Integer idFaq);
	
	public Boolean acceptFaq(Integer idFaq);
	
	public Boolean removeFaq(Integer idFaq);
	/**
	 * Utility class for simplifying access to the instance of async service.
	 */
	public static class Util {
		private static ServiceFaqAsync instance;
		public static ServiceFaqAsync getInstance(){
			if (instance == null) {
				instance = (ServiceFaqAsync) GWT.create(ServiceFaq.class);
				ServiceDefTarget target = (ServiceDefTarget) instance;
				target.setServiceEntryPoint(GWT.getModuleBaseURL() + "ServiceFaq");
			}
			return instance;
		}
	}
}
